enum AppEnvEnum { release, dev, production, hotfix }

Map<AppEnvEnum, String> appEnvEnumMap = {
  AppEnvEnum.release: 'release',
  AppEnvEnum.dev: 'dev',
  AppEnvEnum.production: 'production',
  AppEnvEnum.hotfix: 'hotfix'
};

class Config {
  /// 是否显示调试布局
  static const bool showDebugTool = true;

  /// 是否是 release 环境
  static bool get isRelease => const bool.fromEnvironment("dart.vm.product");

  /// app 环境
  static const AppEnvEnum ENV = AppEnvEnum.production;

  // 安装包下载地址
  static const String downInfo = 'https://down.33eb.cn/mFg4Ex';

  //应用名
  static const String appName = 'flutter_cli';

  // webScoket地址
  static const String webSocket = 'ws://app.yzaizn.top:7072';

  /// 域名
  static String get domain {
    switch (ENV) {
      case AppEnvEnum.dev:
      case AppEnvEnum.production:
      case AppEnvEnum.release:
        return 'wanandroid.com';
      case AppEnvEnum.hotfix:
        return 'app.yyzzlh.shop';
      default:
        return 'app.yyzzlh.shop';
    }
  }

  /// api 配置
  static String get host {
    switch (ENV) {
      case AppEnvEnum.dev:
      case AppEnvEnum.production:
      case AppEnvEnum.release:
        return 'https://$domain/';
      case AppEnvEnum.hotfix:
        return 'http://$domain/api/';
      default:
        return 'http://$domain/api/';
    }
  }
}
